package com.kim.bookshop.book.dao;

import java.util.Date;
import java.util.List;

import com.kim.bookshop.book.bean.Book;
import com.kim.bookshop.book.bean.PageBean;
import com.kim.bookshop.order.bean.OrderItem;

public interface BookDao {
	
	public PageBean<Book> searchBook(String bname);
	
	//查询库存
	public  List<Book>  getStack();
	
	//更新库存量
	public void  updateStock(String bid,int count );
	
	//查找某书的库存
	public int getStockByBid(String bid);
	
	//清空库存
	public void cleanStock(String bid);
	
	//添加书籍
	public void add(Book book);
	
	//删除图书
	public void delete(String bid);
	
	//重新上架
	public void  reonline(String bid);
	
	//编辑书籍信息
	public void edit(Book book);
	
	//查询所有书籍
	public List<Book> findAll();
	
	//分页获取
	public PageBean<Book> findAllPage(int pc,int ps);
	
	//分类查询
	public List<Book> findByCategory(String cid);
	
	public PageBean<Book> findByCategoryPage(String cid,int pc,int ps);
	
	//书籍编号查询
	public Book findByBid(String bid);
	
	//查询指定分类下得书籍数量
	public int getCountByCid(String cid);
	
	//畅销
	public List<Book> getPopBooks();
	
	//最新
	public List<Book> getHotBooks(Date date);
	
	//下架书籍
	public  List<Book> getOffLine();
	
}
